cc.Class({
    extends: cc.Component,

    properties: {
        sprite: cc.Sprite,
    },

    // onLoad () {},

    init(count) {
        let index = 0;
        if (count > 16) {
            index = 4;
        } else if (count > 12) {
            index = 3;
        } else if (count > 9) {
            index = 2;
        } else if (count > 7) {
            index = 1;
        } else if (count > 5) {
            index = 0;
        }
        let url = 'textures_for_guosheng/combo/combo' + (index + 1);
        F.Game.gameAudioGS.playEncourage(index);
        F.Common.setSpriteFrame(this.sprite, url, () => {
            this.playFuckEffect();
        })
    },

    playFuckEffect() {
        this.node.scale = 10;
        cc.tween(this.node)
            .to(0.4, { scale: 1 })
            .repeat(5,
                cc.tween()
                     .to(0.08, { opacity: 0 })
                    .to(0.08, { opacity: 255 })
            )
            .delay(0.5)
            .call(() => {
                F.Utils.putPoolFuckNode('nodePoolCombo', this.node);
            })
            .start()
    }

    // update (dt) {},
});
